package com.github.wxiaoqi.security.crm.core.biz;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.github.wxiaoqi.security.crm.core.entity.PersonalAccount;
import com.github.wxiaoqi.security.crm.core.entity.PersonalInfo;
import com.github.wxiaoqi.security.crm.core.mapper.PersonalAccountMapper;

import lombok.extern.slf4j.Slf4j;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.crm.request.PersonalAccountRequest;
import com.github.wxiaoqi.security.common.crm.request.QueryPersonalBaseListRequest;
import com.github.wxiaoqi.security.common.msg.ResponseCode;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.util.EntityUtils;
import com.github.wxiaoqi.security.common.util.Query;

/**
 * 个人账户信息
 *
 * @author centerroot
 * @email ${email}
 * @date 2018-07-16 10:15:49
 */
@Slf4j
@Service
public class PersonalAccountBiz extends BaseBiz<PersonalAccountMapper,PersonalAccount> {
	
	/**
	 * 查询个人账户信息列表
	 * @author centerroot
	 * @time 创建时间:2018年7月16日下午6:02:38
	 * @param queryPersonalBaseListRequest
	 * @return
	 */
	public Map<String, Object> queryList(PersonalAccountRequest personalAccountRequest){
		log.info("【查询个人账户信息列表】   请求参数：{}",EntityUtils.beanToMap(personalAccountRequest));
		Map<String, Object> respMap = new HashMap<String, Object>();
		String platformId = personalAccountRequest.getPlatformId();
		String personalId = personalAccountRequest.getPersonalId();
		int page = personalAccountRequest.getPage();
		int limit = personalAccountRequest.getLimit();
		
	    PersonalAccount personalAccountReq = new PersonalAccount();
	    personalAccountReq.setPersonalId(personalId);
	    personalAccountReq.setPlatformId(platformId);
        List<PersonalAccount> list = mapper.select(personalAccountReq);
        respMap.put("personalAccountList", list);
        respMap.put("code", ResponseCode.OK.getCode());
        respMap.put("msg", ResponseCode.OK.getMessage());
		log.info("【查询个人账户信息列表】   响应参数：{}",respMap);
		return respMap;
	}
}